//
//  MacroDefinition.h
//  MSP2PText
//
//  Created by 蔡晓博 on 14-12-1.
//  Copyright (c) 2014年 蔡晓博. All rights reserved.
//


#ifndef MSP2PText_MacroDefinition_h
#define MSP2PText_MacroDefinition_h


#pragma mark - 密码控件
/**************************************************************************************/
//**************************测试环境——密码控件**********************//
//公钥证书  Public Key
#define  RSA_PUBLIC_KEY_TEST [[NSMutableDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"serverUrl" ofType:@"plist"]]objectForKey:@"RSA_PUBLIC_KEY_TEST"]

//公钥签名   Public Key SIG
#define RSA_PUBLIC_KEY_SIG_TEST [[NSMutableDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"serverUrl" ofType:@"plist"]]objectForKey:@"RSA_PUBLIC_KEY_SIG_TEST"]


//**************************111:60040——密码控件**********************//
//公钥证书  Public Key
#define  RSA_PUBLIC_KEY_DATA_TEST [[NSMutableDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"serverUrl" ofType:@"plist"]]objectForKey:@"RSA_PUBLIC_KEY_DATA_TEST"]

//公钥签名   Public Key SIG
#define RSA_PUBLIC_KEY_SIG_DATA_TEST [[NSMutableDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"serverUrl" ofType:@"plist"]]objectForKey:@"RSA_PUBLIC_KEY_SIG_DATA_TEST"]


//**************************生产环境——密码控件**********************//
//公钥证书  Public Key
#define  RSA_PUBLIC_KEY_PROD [[NSMutableDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"serverUrl" ofType:@"plist"]]objectForKey:@"RSA_PUBLIC_KEY_PROD"]

//公钥签名   Public Key SIG
#define RSA_PUBLIC_KEY_SIG_PROD [[NSMutableDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"serverUrl" ofType:@"plist"]]objectForKey:@"RSA_PUBLIC_KEY_SIG_PROD"]
/**************************************************************************************/




#pragma mark - 服务器地址环境
/**************************************************************************************/
/***********测试环境**********/
#define kServerUrlTestString [[NSMutableDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"serverUrl" ofType:@"plist"]]objectForKey:@"kServerUrlTest"]

/***********111:60040环境**********/
#define kServerUrlDataTestString [[NSMutableDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"serverUrl" ofType:@"plist"]]objectForKey:@"kServerUrlDataTest"]


/***********生产环境**********/
#define kServerUrlProdString [[NSMutableDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"serverUrl" ofType:@"plist"]]objectForKey:@"kServerUrlProd"]
/**************************************************************************************/



#pragma mark - 银联环境
/**************************************************************************************/
/*****************银联测试环境 Mode (01 测试)) *************/
#define kUPPayPluginModeTest [[NSMutableDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"serverUrl" ofType:@"plist"]]objectForKey:@"kUPPayPluginModeTest"]


/*****************银联测试环境 Mode (01 测试)) *************/
#define kUPPayPluginModeDataTest [[NSMutableDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"serverUrl" ofType:@"plist"]]objectForKey:@"kUPPayPluginModeDataTest"]


/*****************银联生产环境 Mode (00 生产)*************/
#define kUPPayPluginModeProd [[NSMutableDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"serverUrl" ofType:@"plist"]]objectForKey:@"kUPPayPluginModeProd"]
/**************************************************************************************/




/***********************读取Bundle中的nib文件***************************/
#define kBundlePath [[NSBundle mainBundle]pathForResource:@"CMBCP2PBundle" ofType:@"bundle"]


/***********************读取Bundle路径下图片****************************/
#define kImagePath @"CMBCP2PBundle.bundle/"





//InterfaceDelegate 提示信息
typedef enum : NSInteger{
    CMBCSuccess = 0,    //成功
    CMBCCancel,         //用户返回
    CMBCFailed,         //失败
}InterFaceDeleReturnStr;


/**
 *  CMBC_P2P_SDK日志打印 宏定义
 *
 *  @param FORMAT
 *  @param ...
 *
 *  @return
 */
#ifdef DEBUG

#define NSLog(FORMAT, ...) do {fprintf(stderr,"\n CMBC_P2P_SDK********Function:%s Line Number:%d Content:%s\n", __FUNCTION__, __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);} while (0);

//#define NSLog(...) do { } while (0)


#else

#define NSLog(FORMAT, ...) do {fprintf(stderr,"\n CMBC_P2P_SDK********Function:%s Line Number:%d Content:%s\n", __FUNCTION__, __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);} while (0);

//#define NSLog(...) do { } while (0)

#endif


/***************************获取屏幕宽度*******************************/
#define CMBCUISCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)


/***************************获取屏幕高度*******************************/
#define CMBCUISCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)


/***************************获取不同设备的高度**************************/
#define CMBC_IPHONE6PLUS ([UIScreen mainScreen].bounds.size.height < 736)
#define CMBC_IPHONE6 ([UIScreen mainScreen].bounds.size.height < 667)
#define CMBC_IPHONE5AND5S ([UIScreen mainScreen].bounds.size.height < 568)

/***************************当前设备版本****************************/
#define iOSVersion [[[UIDevice currentDevice] systemVersion] floatValue]

/************************* 取有效值 **********************************/
#define EffectiveValue(x) (x.length == 0)?@"":x


#endif
